package cn.dinkevin.xui;

import android.content.Context;
import android.os.Environment;
import java.io.File;

import cn.dinkevin.xui.cache.ACache;
import cn.dinkevin.xui.cache.CacheManager;
import cn.dinkevin.xui.thread.ThreadExecutor;

/**
 * XUI 模块入口
 * Created by ChengPengFei on 2017/3/15 0015.</br>
 * Copyright ©2017 juziwl, All Rights Reserved.
 */

public final class XUI {

    private XUI(){}

    private static XUI g_singleton = new XUI();
    public static Context g_context;

    public final static String ROOT_NAME = "AutoGate";


    /**
     * SD 根目录
     */
    public final static String SD_ROOT = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator;

    /**
     * 数据根目录
     */
    public final static String ROOT_PATH = SD_ROOT + ROOT_NAME + File.separator;


    /**
     * 应用的缓存目录
     * @return
     */
    public String getAppCacheRoot(){
        return g_context.getExternalCacheDir().getAbsolutePath() + File.separator;
    }


    /**
     * 初始化
     * @param context
     */
    public static void initial(Context context){
        g_context = context;
    }


    public Context getContext(){
        return g_context;
    }


    public static XUI getInstance(){
        return g_singleton;
    }
}
